
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>链路监控-Sleuth · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-sidebar-style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="17.注册中心&配置中心-nacos.html" />
    
    
    <link rel="prev" href="15.消息驱动-stream.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">基础篇</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../java基础/IO流基础.html">
            
                <a href="../java基础/IO流基础.html">
            
                    
                    IO流基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../java基础/集合.html">
            
                <a href="../java基础/集合.html">
            
                    
                    集合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="../java基础/异常处理.html">
            
                <a href="../java基础/异常处理.html">
            
                    
                    异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="../java基础/线程.html">
            
                <a href="../java基础/线程.html">
            
                    
                    线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="../java基础/网络编程.html">
            
                <a href="../java基础/网络编程.html">
            
                    
                    网络编程
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">进阶篇</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../java进阶/MySQL.html">
            
                <a href="../java进阶/MySQL.html">
            
                    
                    MySQL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../java进阶/Oracle.html">
            
                <a href="../java进阶/Oracle.html">
            
                    
                    Oracle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="../java进阶/Redis.html">
            
                <a href="../java进阶/Redis.html">
            
                    
                    Redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="../java进阶/Netty.html">
            
                <a href="../java进阶/Netty.html">
            
                    
                    Netty
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="../java进阶/Spring.html">
            
                <a href="../java进阶/Spring.html">
            
                    
                    Spring
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="../java进阶/SpringMVC.html">
            
                <a href="../java进阶/SpringMVC.html">
            
                    
                    SpringMVC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="../java进阶/单元测试.html">
            
                <a href="../java进阶/单元测试.html">
            
                    
                    SpringBoot单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="../java进阶/设计模式.html">
            
                <a href="../java进阶/设计模式.html">
            
                    
                    二十三个设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.8.1" data-path="../java进阶/工厂模式.html">
            
                <a href="../java进阶/工厂模式.html">
            
                    
                    工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.2" data-path="../java进阶/单例模式.html">
            
                <a href="../java进阶/单例模式.html">
            
                    
                    单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.3" data-path="../java进阶/建造者模式.html">
            
                <a href="../java进阶/建造者模式.html">
            
                    
                    建造者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.4" data-path="../java进阶/原型模式.html">
            
                <a href="../java进阶/原型模式.html">
            
                    
                    原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.5" data-path="../java进阶/适配器模式.html">
            
                <a href="../java进阶/适配器模式.html">
            
                    
                    适配器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.6" data-path="../java进阶/责任链模式.html">
            
                <a href="../java进阶/责任链模式.html">
            
                    
                    责任链模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8.7" data-path="../java进阶/桥接模式.html">
            
                <a href="../java进阶/桥接模式.html">
            
                    
                    桥接模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">高级篇</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="1.cloud架构选型.html">
            
                <a href="1.cloud架构选型.html">
            
                    
                    Spring Cloud
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="2.Provider-支付模块.html">
            
                <a href="2.Provider-支付模块.html">
            
                    
                    Provider-支付模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="3.Consumer-订单模块.html">
            
                <a href="3.Consumer-订单模块.html">
            
                    
                    Consumer-订单模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3" data-path="4.重构-Common模块.html">
            
                <a href="4.重构-Common模块.html">
            
                    
                    重构-Common模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4" data-path="5.注册中心-Enreka.html">
            
                <a href="5.注册中心-Enreka.html">
            
                    
                    注册中心-Enreka
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5" data-path="6.负载均衡-@LoadBalance.html">
            
                <a href="6.负载均衡-@LoadBalance.html">
            
                    
                    负载均衡-@LoadBalance
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.6" data-path="7.更换注册中心-Zookeeper.html">
            
                <a href="7.更换注册中心-Zookeeper.html">
            
                    
                    更换注册中心-Zookeeper
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.7" data-path="8.更换注册中心-Consul.html">
            
                <a href="8.更换注册中心-Consul.html">
            
                    
                    更换注册中心-Consul
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.8" data-path="9.负载均衡-Ribbon.html">
            
                <a href="9.负载均衡-Ribbon.html">
            
                    
                    负载均衡-Ribbon
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.9" data-path="10.服务调用-OpenFeign.html">
            
                <a href="10.服务调用-OpenFeign.html">
            
                    
                    服务调用-OpenFeign
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.10" data-path="11.熔断器-Hystrix.html">
            
                <a href="11.熔断器-Hystrix.html">
            
                    
                    熔断器-Hystrix
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.11" data-path="12.网关-Gateway.html">
            
                <a href="12.网关-Gateway.html">
            
                    
                    网关-Gateway
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.12" data-path="13.配置中心-Config.html">
            
                <a href="13.配置中心-Config.html">
            
                    
                    配置中心-Config
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.13" data-path="14.消息总线-bus.html">
            
                <a href="14.消息总线-bus.html">
            
                    
                    消息总线-Bus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.14" data-path="15.消息驱动-stream.html">
            
                <a href="15.消息驱动-stream.html">
            
                    
                    消息驱动-Stream
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="4.1.15" data-path="16.链路监控-Sleuth.html">
            
                <a href="16.链路监控-Sleuth.html">
            
                    
                    链路监控-Sleuth
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.16" data-path="17.注册中心&配置中心-nacos.html">
            
                <a href="17.注册中心&配置中心-nacos.html">
            
                    
                    注册中心&配置中心-nacos
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.17" data-path="18.限流-sentinel.html">
            
                <a href="18.限流-sentinel.html">
            
                    
                    限流-sentinel
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="../java高级/JUC.html">
            
                <a href="../java高级/JUC.html">
            
                    
                    神秘的JUC包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="../java高级/Docker.html">
            
                <a href="../java高级/Docker.html">
            
                    
                    Docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="../java高级/布隆过滤器.html">
            
                <a href="../java高级/布隆过滤器.html">
            
                    
                    布隆过滤器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="../java高级/Redission.html">
            
                <a href="../java高级/Redission.html">
            
                    
                    Redission
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="../java高级/MQ.html">
            
                <a href="../java高级/MQ.html">
            
                    
                    消息队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="../java高级/JVM.html">
            
                <a href="../java高级/JVM.html">
            
                    
                    JVM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="../java书籍/《Effective Java》读书笔记.html">
            
                <a href="../java书籍/《Effective Java》读书笔记.html">
            
                    
                    《Effective Java》读书笔记 
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.8.1" data-path="../java书籍/创建和销毁对象.html">
            
                <a href="../java书籍/创建和销毁对象.html">
            
                    
                    创建和销毁对象
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">番外篇</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../java面试/面试题.html">
            
                <a href="../java面试/面试题.html">
            
                    
                    面试题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../番外篇/小程序.html">
            
                <a href="../番外篇/小程序.html">
            
                    
                    微信小程序
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >链路监控-Sleuth</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="1&#x6982;&#x8FF0;"><a name="1&#x6982;&#x8FF0;" class="plugin-anchor" href="#1&#x6982;&#x8FF0;"><i class="fa fa-link" aria-hidden="true"></i></a>1.&#x6982;&#x8FF0;</h2>
<p>&#x2003;&#x5FAE;&#x670D;&#x52A1;&#x8DDF;&#x8E2A;(sleuth)&#x5176;&#x5B9E;&#x662F;&#x4E00;&#x4E2A;&#x5DE5;&#x5177;,&#x5B83;&#x5728;&#x6574;&#x4E2A;&#x5206;&#x5E03;&#x5F0F;&#x7CFB;&#x7EDF;&#x4E2D;&#x80FD;&#x8DDF;&#x8E2A;&#x4E00;&#x4E2A;&#x7528;&#x6237;&#x8BF7;&#x6C42;&#x7684;&#x8FC7;&#x7A0B;(&#x5305;&#x62EC;&#x6570;&#x636E;&#x91C7;&#x96C6;&#xFF0C;&#x6570;&#x636E;&#x4F20;&#x8F93;&#xFF0C;&#x6570;&#x636E;&#x5B58;&#x50A8;&#xFF0C;&#x6570;&#x636E;&#x5206;&#x6790;&#xFF0C;&#x6570;&#x636E;&#x53EF;&#x89C6;&#x5316;)&#xFF0C;&#x6355;&#x83B7;&#x8FD9;&#x4E9B;&#x8DDF;&#x8E2A;&#x6570;&#x636E;&#xFF0C;&#x5C31;&#x80FD;&#x6784;&#x5EFA;&#x5FAE;&#x670D;&#x52A1;&#x7684;&#x6574;&#x4E2A;&#x8C03;&#x7528;&#x94FE;&#x7684;&#x89C6;&#x56FE;&#xFF0C;&#x8FD9;&#x662F;&#x8C03;&#x8BD5;&#x548C;&#x76D1;&#x63A7;&#x5FAE;&#x670D;&#x52A1;&#x7684;&#x5173;&#x952E;&#x5DE5;&#x5177;&#x3002;</p>
<table>
<thead>
<tr>
<th>&#x7279;&#x70B9;</th>
<th>&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x63D0;&#x4F9B;&#x94FE;&#x8DEF;&#x8FFD;&#x8E2A;</td>
<td>&#x901A;&#x8FC7;sleuth&#x53EF;&#x4EE5;&#x5F88;&#x6E05;&#x695A;&#x7684;&#x770B;&#x51FA;&#x4E00;&#x4E2A;&#x8BF7;&#x6C42;&#x7ECF;&#x8FC7;&#x4E86;&#x90A3;&#x4E9B;&#x670D;&#x52A1;&#xFF0C;&#x53EF;&#x4EE5;&#x65B9;&#x4FBF;&#x7684;&#x7406;&#x6E05;&#x670D;&#x52A1;&#x7684;&#x8C03;&#x7528;&#x5173;&#x7CFB;</td>
</tr>
<tr>
<td>&#x6027;&#x80FD;&#x5206;&#x6790;</td>
<td>&#x901A;&#x8FC7;sleuth&#x53EF;&#x4EE5;&#x5F88;&#x65B9;&#x4FBF;&#x7684;&#x770B;&#x51FA;&#x6BCF;&#x4E2A;&#x91C7;&#x96C6;&#x7684;&#x8BF7;&#x6C42;&#x8017;&#x65F6;</td>
</tr>
<tr>
<td>&#x6570;&#x636E;&#x5206;&#x6790;&#x4F18;&#x5316;&#x94FE;&#x8DEF;</td>
<td>&#x5BF9;&#x4E8E;&#x9891;&#x7E41;&#x7684;&#x8C03;&#x7528;&#x4E00;&#x4E2A;&#x670D;&#x52A1;&#xFF0C;&#x6216;&#x8005;&#x5E76;&#x884C;&#x5730;&#x8C03;&#x7528;&#x7B49;&#xFF0C;&#x9488;&#x5BF9;&#x4E1A;&#x52A1;&#x505A;&#x4E00;&#x4E9B;&#x4F18;&#x5316;</td>
</tr>
<tr>
<td>&#x53EF;&#x89C6;&#x5316;</td>
<td>&#x5BF9;&#x4E8E;&#x7A0B;&#x5E8F;&#x672A;&#x6355;&#x83B7;&#x7684;&#x5F02;&#x5E38;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;zipkin&#x754C;&#x9762;&#x4E0A;&#x770B;&#x5230;</td>
</tr>
</tbody>
</table>
<h2 id="2&#x642D;&#x5EFA;zipkin"><a name="2&#x642D;&#x5EFA;zipkin" class="plugin-anchor" href="#2&#x642D;&#x5EFA;zipkin"><i class="fa fa-link" aria-hidden="true"></i></a>2.&#x642D;&#x5EFA;zipkin</h2>
<p><strong>&#x4EC0;&#x4E48;&#x662F;Zipkin</strong></p>
<p><a href="https://link.zhihu.com/?target=https%3A//zipkin.io/" target="_blank">Zipkin</a> &#x662F; Twitter &#x516C;&#x53F8;&#x5F00;&#x53D1;&#x8D21;&#x732E;&#x7684;&#x4E00;&#x6B3E;&#x5F00;&#x6E90;&#x7684;&#x5206;&#x5E03;&#x5F0F;&#x5B9E;&#x65F6;&#x6570;&#x636E;&#x8FFD;&#x8E2A;&#x7CFB;&#x7EDF;&#xFF08;Distributed Tracking System&#xFF09;&#xFF0C;&#x57FA;&#x4E8E; Google Dapper &#x7684;&#x8BBA;&#x6587;&#x8BBE;&#x8BA1;&#x800C;&#x6765;&#xFF0C;&#x5176;&#x4E3B;&#x8981;&#x529F;&#x80FD;&#x662F;&#x805A;&#x96C6;&#x5404;&#x4E2A;&#x5F02;&#x6784;&#x7CFB;&#x7EDF;&#x7684;&#x5B9E;&#x65F6;&#x76D1;&#x63A7;&#x6570;&#x636E;&#x3002;</p>
<p>&#x5B83;&#x53EF;&#x4EE5;&#x6536;&#x96C6;&#x5404;&#x4E2A;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x8BF7;&#x6C42;&#x94FE;&#x8DEF;&#x7684;&#x8DDF;&#x8E2A;&#x6570;&#x636E;&#xFF0C;&#x5E76;&#x901A;&#x8FC7; Rest API &#x63A5;&#x53E3;&#x6765;&#x8F85;&#x52A9;&#x6211;&#x4EEC;&#x67E5;&#x8BE2;&#x8DDF;&#x8E2A;&#x6570;&#x636E;&#xFF0C;&#x5B9E;&#x73B0;&#x5BF9;&#x5206;&#x5E03;&#x5F0F;&#x7CFB;&#x7EDF;&#x7684;&#x5B9E;&#x65F6;&#x76D1;&#x63A7;&#xFF0C;&#x53CA;&#x65F6;&#x53D1;&#x73B0;&#x7CFB;&#x7EDF;&#x4E2D;&#x51FA;&#x73B0;&#x7684;&#x5EF6;&#x8FDF;&#x5347;&#x9AD8;&#x95EE;&#x9898;&#x5E76;&#x627E;&#x51FA;&#x7CFB;&#x7EDF;&#x6027;&#x80FD;&#x74F6;&#x9888;&#x7684;&#x6839;&#x6E90;&#x3002;&#x9664;&#x4E86;&#x9762;&#x5411;&#x5F00;&#x53D1;&#x7684; API &#x63A5;&#x53E3;&#x4E4B;&#x5916;&#xFF0C;&#x5B83;&#x8FD8;&#x63D0;&#x4F9B;&#x4E86;&#x65B9;&#x4FBF;&#x7684; UI &#x7EC4;&#x4EF6;&#xFF0C;&#x6BCF;&#x4E2A;&#x670D;&#x52A1;&#x5411; Zipkin &#x62A5;&#x544A;&#x8BA1;&#x65F6;&#x6570;&#x636E;&#xFF0C;Zipkin &#x4F1A;&#x6839;&#x636E;&#x8C03;&#x7528;&#x5173;&#x7CFB;&#x751F;&#x6210;&#x4F9D;&#x8D56;&#x5173;&#x7CFB;&#x56FE;&#xFF0C;&#x5E2E;&#x52A9;&#x6211;&#x4EEC;&#x76F4;&#x89C2;&#x7684;&#x641C;&#x7D22;&#x8DDF;&#x8E2A;&#x4FE1;&#x606F;&#x548C;&#x5206;&#x6790;&#x8BF7;&#x6C42;&#x94FE;&#x8DEF;&#x660E;&#x7EC6;&#x3002;Zipkin &#x63D0;&#x4F9B;&#x4E86;&#x53EF;&#x63D2;&#x62D4;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x65B9;&#x5F0F;&#xFF1A;In-Memory&#x3001;MySql&#x3001;Cassandra &#x4EE5;&#x53CA; Elasticsearch&#x3002;</p>
<p>Zipkin &#x5206;&#x4E3A;&#x4E24;&#x7AEF;&#xFF0C;&#x4E00;&#x4E2A;&#x662F; Zipkin &#x670D;&#x52A1;&#x7AEF;&#xFF0C;&#x4E00;&#x4E2A;&#x662F; Zipkin &#x5BA2;&#x6237;&#x7AEF;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x4E5F;&#x5C31;&#x662F;&#x5FAE;&#x670D;&#x52A1;&#x7684;&#x5E94;&#x7528;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x4F1A;&#x914D;&#x7F6E;&#x670D;&#x52A1;&#x7AEF;&#x7684; URL &#x5730;&#x5740;&#xFF0C;&#x4E00;&#x65E6;&#x53D1;&#x751F;&#x670D;&#x52A1;&#x95F4;&#x7684;&#x8C03;&#x7528;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4F1A;&#x88AB;&#x914D;&#x7F6E;&#x5728;&#x5FAE;&#x670D;&#x52A1;&#x91CC;&#x9762;&#x7684; Sleuth &#x7684;&#x76D1;&#x542C;&#x5668;&#x76D1;&#x542C;&#xFF0C;&#x5E76;&#x751F;&#x6210;&#x76F8;&#x5E94;&#x7684; Trace &#x548C; Span &#x4FE1;&#x606F;&#x53D1;&#x9001;&#x7ED9;&#x670D;&#x52A1;&#x7AEF;&#x3002;&#x53D1;&#x9001;&#x7684;&#x65B9;&#x5F0F;&#x6709;&#x4E24;&#x79CD;&#xFF0C;&#x4E00;&#x79CD;&#x662F;&#x6D88;&#x606F;&#x603B;&#x7EBF;&#x7684;&#x65B9;&#x5F0F;&#x5982; RabbitMQ &#x53D1;&#x9001;&#xFF0C;&#x8FD8;&#x6709;&#x4E00;&#x79CD;&#x662F; HTTP &#x62A5;&#x6587;&#x7684;&#x65B9;&#x5F0F;&#x53D1;&#x9001;&#x3002;</p>
<p><strong>&#x63A5;&#x4E0B;&#x6765;&#x90E8;&#x7F72;&#x670D;&#x52A1;&#x7AEF;&#xFF1A;</strong></p>
<ul>
<li><p><a href="https://search.maven.org/remote_content?g=io.zipkin.java&amp;a=zipkin-server&amp;v=LATEST&amp;c=exec" target="_blank">zipkin-server.jar&#x4E0B;&#x8F7D;</a> &#x4E0B;&#x8F7D;&#x5BF9;&#x5E94;&#x7684;jar&#x5305;&#x7136;&#x540E;&#x672C;&#x5730;&#x542F;&#x52A8;</p>
</li>
<li><p><code>java -jar &#x4F60;&#x7684;jar&#x8DEF;&#x5F84;</code></p>
</li>
<li><p>&#x7136;&#x540E;&#x8BBF;&#x95EE; <a href="http://localhost:9411" target="_blank">http://localhost:9411</a> &#x53EF;&#x4EE5;&#x770B;&#x5230;zipkin&#x7684;&#x754C;&#x9762;</p>
</li>
</ul>
<p><img src="https://tva1.sinaimg.cn/large/e6c9d24ely1h449yu6husj21h10u0ta8.jpg" alt=""></p>
<p>&#x6216;&#x8005;&#x4F7F;&#x7528;docker &#x90E8;&#x7F72;</p>
<pre><code class="lang-shell">$ docker pull openzipkin/zipkin
$ docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin
</code></pre>
<h2 id="3&#x642D;&#x5EFA;&#x5BA2;&#x6237;&#x7AEF;"><a name="3&#x642D;&#x5EFA;&#x5BA2;&#x6237;&#x7AEF;" class="plugin-anchor" href="#3&#x642D;&#x5EFA;&#x5BA2;&#x6237;&#x7AEF;"><i class="fa fa-link" aria-hidden="true"></i></a>3.&#x642D;&#x5EFA;&#x5BA2;&#x6237;&#x7AEF;</h2>
<p>&#x5BF9;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x8005;&#x548C;&#x670D;&#x52A1;&#x6D88;&#x8D39;&#x8005;&#x8FDB;&#x884C;&#x6539;&#x9020;</p>
<p><strong>&#x9996;&#x5148;&#x4FEE;&#x6539;&#x670D;&#x52A1;&#x63D0;&#x4F9B;&#x8005;payment&#x9879;&#x76EE;</strong></p>
<ul>
<li>pom&#x4E2D;&#x6DFB;&#x52A0;&#x5982;&#x4E0B;&#x4F9D;&#x8D56;</li>
</ul>
<pre><code class="lang-xml"> <span class="hljs-comment">&lt;!--&#x5305;&#x542B;zipkin&#x548C;sleuth--&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.springframework.cloud<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>spring-cloud-starter-zipkin<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span>
 <span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span>
</code></pre>
<ul>
<li>&#x4FEE;&#x6539;application.yml</li>
</ul>
<pre><code class="lang-yml"><span class="hljs-attr">server:</span>
<span class="hljs-attr">  port:</span> <span class="hljs-number">8001</span>

<span class="hljs-attr">spring:</span>
<span class="hljs-attr">  application:</span>
<span class="hljs-attr">    name:</span> eureka-provider-payment

  <span class="hljs-comment"># steam &#x914D;&#x7F6E;</span>
<span class="hljs-attr">  cloud:</span>
<span class="hljs-attr">    stream:</span>
<span class="hljs-attr">      binders:</span>                                                  <span class="hljs-comment"># &#x6B64;&#x5904;&#x914D;&#x7F6E;&#x8981;&#x7ED1;&#x5B9A;&#x7684;rabbitmq&#x7684;&#x670D;&#x52A1;&#x4FE1;&#x606F;</span>
<span class="hljs-attr">        defaultRabbit:</span>                                          <span class="hljs-comment"># &#x8868;&#x793A;&#x5B9A;&#x4E49;&#x7684;&#x540D;&#x79F0;&#xFF0C;&#x7528;&#x4E8E;&#x4E0E;binding&#x6574;&#x5408;</span>
<span class="hljs-attr">          type:</span> rabbit                                          <span class="hljs-comment"># &#x6D88;&#x606F;&#x7EC4;&#x4EF6;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x5982;&#x679C;&#x662F;kafka&#x5C31;&#x5199;kafka</span>
<span class="hljs-attr">      bindings:</span>                                                 <span class="hljs-comment"># &#x670D;&#x52A1;&#x7684;&#x6574;&#x5408;&#x5904;&#x7406;</span>
<span class="hljs-attr">        output:</span>                                                 <span class="hljs-comment"># &#x901A;&#x9053;(channel)&#x7684;&#x540D;&#x79F0;</span>
<span class="hljs-attr">          destination:</span> studyExhange                             <span class="hljs-comment"># &#x8868;&#x793A;&#x8981;&#x4F7F;&#x7528;&#x7684;Exchange&#x540D;&#x79F0;</span>
<span class="hljs-attr">          content-type:</span> application/json                        <span class="hljs-comment"># &#x8BBE;&#x7F6E;&#x6D88;&#x606F;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x6587;&#x672C;&#x5219;&#x4E3A; &quot;text/plain&quot;</span>
<span class="hljs-attr">          binder:</span> defaultRabbit                                 <span class="hljs-comment"># &#x8BBE;&#x7F6E;&#x8981;&#x7ED1;&#x5B9A;&#x7684;&#x6D88;&#x606F;&#x670D;&#x52A1;&#x7684;&#x5177;&#x4F53;&#x8BBE;&#x7F6E;</span>

  <span class="hljs-comment"># rabbitMQ&#x914D;&#x7F6E;</span>
<span class="hljs-attr">  rabbitmq:</span>
<span class="hljs-attr">    host:</span> ip
<span class="hljs-attr">    port:</span> <span class="hljs-number">5672</span>
<span class="hljs-attr">    username:</span> guest
<span class="hljs-attr">    password:</span> guest

  <span class="hljs-comment"># &#x6570;&#x636E;&#x5E93;&#x914D;&#x7F6E;</span>
<span class="hljs-attr">  datasource:</span>
<span class="hljs-attr">    type:</span> com.alibaba.druid.pool.DruidDataSource
<span class="hljs-attr">    driver-class-name:</span> org.gjt.mm.mysql.Driver
<span class="hljs-attr">    url:</span> jdbc:mysql://ip:<span class="hljs-number">3306</span>/bigdata?useUnicode=<span class="hljs-literal">true</span>&amp;characterEncoding=utf<span class="hljs-bullet">-8</span>&amp;useSSL=<span class="hljs-literal">false</span>
<span class="hljs-attr">    username:</span> root
<span class="hljs-attr">    password:</span> ***

  <span class="hljs-comment">#zipkin &#x94FE;&#x8DEF;&#x76D1;&#x63A7;&#x914D;&#x7F6E;</span>
<span class="hljs-attr">  zipkin:</span>
<span class="hljs-attr">    base-url:</span> http://ip:<span class="hljs-number">9411</span>
<span class="hljs-attr">  sleuth:</span>
<span class="hljs-attr">    sampler:</span>
      <span class="hljs-comment"># &#x91C7;&#x6837;&#x7387; 0&#xFF5E;1 ,1&#x8868;&#x793A;&#x5168;&#x90E8;&#x91C7;&#x96C6;</span>
<span class="hljs-attr">      probability:</span> <span class="hljs-number">1</span>

<span class="hljs-attr">mybatis:</span>
<span class="hljs-attr">  mapper-locations:</span> classpath:sqlMapper/*.xml
<span class="hljs-attr">  type-aliases-package:</span> com.springcloud.entities  <span class="hljs-comment"># &#x6240;&#x5728;entity&#x522B;&#x540D;&#x7C7B;&#x6240;&#x5728;&#x5305;</span>

<span class="hljs-attr">eureka:</span>
<span class="hljs-attr">  client:</span>
<span class="hljs-attr">    register-with-eureka:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    fetch-registry:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">    service-url:</span>
<span class="hljs-attr">      defaultZone:</span> http://localhost:<span class="hljs-number">7001</span>/eureka/
</code></pre>
<p><strong>&#x7136;&#x540E;&#x4FEE;&#x6539;&#x670D;&#x52A1;&#x6D88;&#x8D39;&#x8005;order&#x9879;&#x76EE;</strong></p>
<p>&#x4E0E;&#x4E0A;main&#x4FEE;&#x6539;&#x4E00;&#x6837;&#xFF0C;&#x4E0D;&#x518D;&#x8D58;&#x8FF0;&#x3002;</p>
<p><strong>&#x6700;&#x540E;&#x542F;&#x52A8;&#x6D4B;&#x8BD5;&#xFF0C;&#x968F;&#x610F;&#x8BBF;&#x95EE;&#x4E00;&#x4E2A;&#x670D;&#x52A1;&#x95F4;&#x8C03;&#x7528;&#x7684;&#x8BF7;&#x6C42;</strong></p>
<p>&#x67E5;&#x770B;<a href="http://localhost:9411" target="_blank">http://localhost:9411</a> &#x9875;&#x9762;&#x7684;&#x53D8;&#x5316;</p>
<h2 id="4-&#x589E;&#x52A0;&#x65E5;&#x5FD7;&#x8DDF;&#x8E2A;traceid"><a name="4-&#x589E;&#x52A0;&#x65E5;&#x5FD7;&#x8DDF;&#x8E2A;traceid" class="plugin-anchor" href="#4-&#x589E;&#x52A0;&#x65E5;&#x5FD7;&#x8DDF;&#x8E2A;traceid"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x589E;&#x52A0;&#x65E5;&#x5FD7;&#x8DDF;&#x8E2A;traceId</h2>
<p>&#x9884;&#x7559;...todo...</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; mine 2022-2025 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2022-07-13 12:19:22
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="15.消息驱动-stream.html" class="navigation navigation-prev " aria-label="Previous page: 消息驱动-Stream">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="17.注册中心&配置中心-nacos.html" class="navigation navigation-next " aria-label="Next page: 注册中心&配置中心-nacos">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"链路监控-Sleuth","level":"4.1.15","depth":2,"next":{"title":"注册中心&配置中心-nacos","level":"4.1.16","depth":2,"path":"springcloud/17.注册中心&配置中心-nacos.md","ref":"springcloud/17.注册中心&配置中心-nacos.md","articles":[]},"previous":{"title":"消息驱动-Stream","level":"4.1.14","depth":2,"path":"springcloud/15.消息驱动-stream.md","ref":"springcloud/15.消息驱动-stream.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["back-to-top-button","code","splitter","expandable-chapters-small","anchors","theme-comscore","tbfed-pagefooter","sidebar-style","pageview-count","popup"],"pluginsConfig":{"sidebar-style":{"author":"梁兴龙","title":"《Java 笔记本》"},"tbfed-pagefooter":{"copyright":"Copyright &copy mine 2022-2025","modify_label":"文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"splitter":{},"search":{},"popup":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"theme-comscore":{},"back-to-top-button":{},"pageview-count":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"springcloud/16.链路监控-Sleuth.md","mtime":"2022-07-13T04:19:22.260Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-08-22T03:22:22.085Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sidebar-style/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

